package com.yr.ryjk.doctor.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.yr.ryjk.doctor.entity.DoctorRegister;
import com.yr.ryjk.doctor.vo.DoctorVO;

public interface DoctorRegisterMapper {
    int deleteByPrimaryKey(String id);

    int insert(DoctorRegister record);

    int insertSelective(DoctorRegister record);

    DoctorRegister selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(DoctorRegister record);

    int updateByPrimaryKey(DoctorRegister record);

    @Select("select * from doctor_register where phone=#{0}")
    @ResultMap("BaseResultMap")
	DoctorRegister selectByPhone(String phone);

	List<DoctorRegister> selectOfPage(int start, int pageSize, int status);

	@Select("select count(1) from doctor_register where register_progress=3 and check_status=#{0}")
	@ResultType(Integer.class)
	int selectCount(int status);

	@Select("select * from doctor_register where find_in_set(id,#{0})")
	@ResultMap("BaseResultMap")
	List<DoctorRegister> selectByIds(String ids);

	@Delete("delete from doctor_register where find_in_set(id,#{0})")
	void deleteByIds(String ids);

	DoctorVO selectVoById(String id);

	@Update("update doctor_register set check_status=#{0},check_desc=#{1} where find_in_set(id,#{2})")
	void updateStatusAndReasonByIds(int i, String reason, String ids);
}